/*
 * @Author: xiaxia
 * @Description: 
 * @Date: 2024-06-26 12:00:40
 * @LastEditTime: 2024-06-28 17:57:23
 * @FilePath: \project\src\api\product\attr\index.ts
 */
import request from "@/utils/request";
import { AttrListResponse, Attr, CategoryResponse } from "./type";

enum API {
  CATEGORY1_URL = "/admin/product/getCategory1",
  CATEGORY2_URL = "/admin/product/getCategory2/",
  CATEGORY3_URL = "/admin/product/getCategory3/",
  ATTRLIST_URL = "/admin/product/attrInfoList/",
  EDITATTR_URL = "/admin/product/saveAttrInfo",
  DELETEATTR_URL = "/admin/product/deleteAttr/",
}

export const reqCategory1 = () => request.get<any, CategoryResponse>(API.CATEGORY1_URL)
export const reqCategory2 = (id:number|string) => request.get<any, CategoryResponse>(API.CATEGORY2_URL+id)
export const reqCategory3 = (id:number|string) => request.get<any, CategoryResponse>(API.CATEGORY3_URL+id)
export const reqAttrList = (id1:number|string, id2:number|string, id3:number|string) => request.get<any, AttrListResponse>(API.ATTRLIST_URL+`${id1}/${id2}/${id3}`)
export const reqAddEditTrademark = (data:Attr)=>request.post<any, any>(API.EDITATTR_URL, data)
export const reqDeletAttr = (attrId:number|string)=>request.delete<any, any>(API.DELETEATTR_URL+attrId)
